package com.et.machine.util

import android.content.Context

class Version {
    companion object {
        fun packageVersion(context: Context, pkg: String): String {
            context.packageManager?.let {
                return try {
                    val info = it.getPackageInfo(pkg, 0)
                    info.versionName
                } catch (e: Exception) {
                    "Not Found $pkg"
                }
            }
            return "PackageManager-Null"
        }
    }
}